#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=10;
typedef int LL;
inline LL read(){LL x=0,f=1;char ch=getchar();	while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
return x*f;}
long long a[maxn];
bool check(LL i,LL j,LL k){
    if(a[i]+a[j]>a[k]&&a[i]+a[k]>a[j]&&a[j]+a[k]>a[i]&&a[i]-a[j]<a[k]&&a[j]-a[i]<a[k]&&a[i]-a[k]<a[j]&&a[k]-a[i]<a[j]&&a[k]-a[j]<a[i]&&a[j]-a[k]<a[i]) return true;
    else return false;
}
int main(void)
{
  ///cin.tie(0);std::ios::sync_with_stdio(false);
  LL t;t=read();
  while(t--){
    LL n;
    n=6;
    for(LL i=1;i<=n;i++) scanf("%lld",&a[i]);
    bool flag=1;
  ///  debug(n);
    for(LL i=1;flag==1&&i<=n;i++){

        for(LL j=1;flag==1&&j<=n;j++){

            if(j==i) continue;

            for(LL k=1;flag==1&&k<=n;k++){
                if(k==i||k==j) continue;

                if(check(i,j,k)){

                    for(LL i2=1;flag==1&&i2<=n;i2++){

                        if(i2==i||i2==j||i2==k) continue;

                        for(LL j2=1;flag==1&&j2<=n;j2++){

                            if(j2==i||j2==j||j2==k||j2==i2) continue;

                            for(LL k2=1;flag==1&&k2<=n;k2++){

                                if(k2==i||k2==j||k2==k||k2==i2||k2==j2) continue;


                                if(check(i2,j2,k2)){
                      //              debug(i);debug(j);debug(k);
                      //              debug(i2);debug(j2);debug(k2);
                                    printf("Yes\n");
                                    flag=0;
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    if(flag==1){
       printf("No\n");
    }
  }
return 0;
}
